Repository navigation
fix(redis): reject subscription close signals when receiving - #42799
Merged
Merged
Conversation
Raise SubscriptionClosedError when a waiting receiver wakes on the internal close signal. Wait for the sharded subscription to become active before starting producers and close it when the concurrent consumer exits.
Contributor
Pyrefly Type Coverage
|
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-09-23 06:47:13.922651700 +0000
+++ /tmp/pyrefly_pr.txt 2026-09-23 06:47:05.922539481 +0000
@@ -759,7 +759,7 @@
ERROR Argument `Literal['owner']` is not assignable to parameter `role` with type `SQLCoreOperations[TenantAccountRole] | TenantAccountRole` in function `models.account.TenantAccountJoin.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/helpers/execution_extra_content.py:48:14
ERROR Returned type `int | str` is not assignable to declared return type `str` [bad-return]
- --> tests/test_containers_integration_tests/libs/broadcast_channel/redis/test_sharded_channel.py:363:16
+ --> tests/test_containers_integration_tests/libs/broadcast_channel/redis/test_sharded_channel.py:367:16
ERROR Object of class `TypeEngine` has no attribute `length` [missing-attribute]
--> tests/test_containers_integration_tests/models/test_types_enum_text.py:104:16
ERROR Object of class `NoneType` has no attribute `user_type` [missing-attribute]
@@ -6931,7 +6931,7 @@
ERROR Argument `None` is not assignable to parameter `value` with type `SQLCoreOperations[bool] | bool` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> tests/unit_tests/services/workflow/test_workflow_draft_variable_service.py:705:37
ERROR Argument `None` is not assignable to parameter `value` with type `SQLCoreOperations[datetime] | datetime` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
- --> tests/unit_tests/services/workflow/test_workflow_event_snapshot_service.py:506:30
+ --> tests/unit_tests/services/workflow/test_workflow_event_snapshot_service.py:507:30
ERROR Argument `dict[str, list[Unknown] | str | dict[str, bool] | dict[str, bool | str] | dict[str, dict[str, bool | int | list[str]]]]` is not assignable to parameter `features` with type `dict[str, object]` in function `_create_workflow` [bad-argument-type]
--> tests/unit_tests/services/workflow/test_workflow_restore.py:62:18
ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #42799 +/- ##
==========================================
+ Coverage 87.78% 87.87% +0.09%
==========================================
Files 5092 5098 +6
Lines 319332 319829 +497
Branches 64543 64584 +41
==========================================
+ Hits 280326 281055 +729
+ Misses 33634 33387 -247
- Partials 5372 5387 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Stream29
self-requested a review
September 24, 2026 02:02
Contributor
|
It feels so good to review a small PR that is easy to read. |
Stream29
approved these changes
Sep 24, 2026
Contributor
|
Simple and clear logic with good tests. LGTM. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A receiver waiting on a Redis subscription can return its internal close signal as application data. Raise the existing subscription-closed exception instead and let workflow event buffering finish quietly on normal shutdown. Ensure concurrent producers start only after the sharded subscription is ready, and close the subscription when its consumer exits.
Extracted from #40277 so this fix can land independently of the Graphon upgrade.